package metier.entities;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="Type_Station")
public class Station {

	
	@Id
	 @GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer IdStation;

	 private String Intitule;
	 private String CodePostal;
	 private boolean Statut;
	 
	 @ManyToOne
	 @JoinColumn(name="idVille")
		 private Ville villeStations;
	 
	 
	 //liste des offre qui ont comment station de départ cette station
	 @OneToMany(mappedBy="station_Depart")
	 private List<Offre> listeOffreDepart=new ArrayList<Offre>();
	 
	 
	 //liste des offre qui ont comment station d'arrivé cette station
	 @OneToMany(mappedBy="station_Arrive")
	 private List<Offre> listeOffreArrivee=new ArrayList<Offre>();
	 
	 
	 
	public Integer getIdStation() {
		return IdStation;
	}
	public void setIdStation(Integer idStation) {
		IdStation = idStation;
	}
	public String getIntitule() {
		return Intitule;
	}
	public void setIntitule(String intitule) {
		Intitule = intitule;
	}
	public String getCodePostal() {
		return CodePostal;
	}
	public void setCodePostal(String codePostal) {
		CodePostal = codePostal;
	}
	public boolean isStatut() {
		return Statut;
	}
	public void setStatut(boolean statut) {
		Statut = statut;
	}
	
	
	
	public Ville getVilleStations() {
		return villeStations;
	}
	public void setVilleStations(Ville villeStations) {
		this.villeStations = villeStations;
	}
	public List<Offre> getListeOffreDepart() {
		return listeOffreDepart;
	}
	public void setListeOffreDepart(List<Offre> listeOffreDepart) {
		this.listeOffreDepart = listeOffreDepart;
	}
	public List<Offre> getListeOffreArrivee() {
		return listeOffreArrivee;
	}
	public void setListeOffreArrivee(List<Offre> listeOffreArrivee) {
		this.listeOffreArrivee = listeOffreArrivee;
	}
	public Station() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Station(Integer idStation, String intitule, String codePostal,
			boolean statut, Ville villeStations) {
		super();
		IdStation = idStation;
		Intitule = intitule;
		CodePostal = codePostal;
		Statut = statut;
		this.villeStations = villeStations;
	}
	
	
	
	
	 
}
